<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <link rel="stylesheet" href="https://static.91haoka.cn/vant.css"/>
        <script src="https://static.91haoka.cn/vue.min.js"></script>
        <script src="https://static.91haoka.cn/vantall.js"></script>
        <script src="https://static.91haoka.cn/axios.min.js"></script>
		<link rel="stylesheet" type="text/css" href="https://static.91haoka.cn/all.css"/>
     </head>
	 <!-- 快手回调用 -->
	 <script type="text/javascript">
	 	(function(root) {
	 		var ksscript = document.createElement('script');
	 		ksscript.setAttribute('charset', 'utf-8');
	 		ksscript.src = '//p2-yx.adkwai.com/udata/pkg/ks-ad-trace-sdk/ks-trace.3.2.0.min.js';
	 		var s = document.getElementsByTagName('script')[0];
	 		s.parentNode.insertBefore(ksscript, s);
	 	})(window);
	 </script>
    <style type="text/css">
		*{ box-sizing: border-box; font-family:'PingFang SC';}
		.p1{ height: 1.3rem; }
		.p1 img{ width:100%; border-radius: 0.1rem;}
		.t1{ font-size: 0.28rem; color: #2D3038;}
		.btnx{ background: #FF3400; border-radius: 0.6rem; color: #fff; font-weight: bold; margin-top: 0.15rem; width: 1.7rem; padding: 0.1rem 0rem; text-align: center;}
		.p2 img{ width: 0.34rem;}
		.t2{ font-size: 0.22rem; margin-top: 0.05rem;}
		.li{ border-bottom: 1px #f1f1f1 solid; padding: 0.3rem 0;}
		.act{ color: #FF3400;}
		.van-tab{ min-width: 25%; max-width: 25%;}
    </style>
	<body>
        <div id="app" style="background: #F3F3F5; min-height:100vh;" v-cloak>
			<img src="img/shangxianyong.png" style="width: 100%;">
        </div>

       
        <script>
            var h = document.documentElement.clientWidth / 7.5 + 'px';
                document.documentElement.style.fontSize = h;

            
            new Vue({
                el: '#app',
                data: function() {
                	return {
						
                	}
                },
                created(){
					
                },
                mounted () {
                   
                },
                methods:{
					onClick:function(){
						console.log(this.all.cat)
						this.getshop()
					},
					
					getfenlei:function(){
						
						axios.get(`${this.apis}/api/mini/catgory/list?tab=${this.getUrlParam('id')}`)
						.then(response => {
							this.fenleilist = response.data.data
							this.fenleilist.unshift({
								cat_id: 0,
								cat_name: "全部"
							})
						})
					},
					
					go_type3:function(item){
						if(item.url){
							window.location.href = item.url
						}
					},
					go_type4:function(item){
					
						//1自定义2联系客服3订单查询
						let url = ''
						if(item.dizhi == 1){
							if(item.url){
								url = item.url
							}
						}
						if(item.dizhi == 2){
							url = './kefu.html'
						}
						if(item.dizhi == 3){
							url = './chadan.html'
						}
					
						window.location.href = url
					},
					getpeizhi:function(){
						let wenjianjia = 'web-store'
						if(window.location.href.includes('storep.91haoka.cn') && this.apis == ''){
							wenjianjia = 'web-store'
						}
						if(window.location.href.includes('store.91haoka.cn') && this.apis == ''){
							wenjianjia = 'test-web-store'
						}
						if(window.location.href.includes('localhost')){
						  wenjianjia = 'test-web-store'
						}
						
						axios.get(`https://file.91haoka.cn/${wenjianjia}/${this.all.tab}.json?v=${Math.random()}`)
						// axios.get(`${this.apis}/storage/web-store/${this.all.tab}.json?v=${Math.random()}`)
						.then(response => {
							this.json = JSON.parse(response.data) 
							
							
							if(!this.xcx){
								console.log(111222)
								this.json.forEach(item=>{
									if(item.type == 5){
										item.radio =2
									}
								})
							}
							
							this.getshop()
						})
					},
					getshop:function(){
						axios.get(`${this.apis}/api/page/list2`,{params:this.all})
						  .then(response => {
						    if(response.data.msg.code == 0){
						      this.list = response.data.data.data
							 //  let fenleilist = []
							  this.list.forEach(item=>{
							  	if(item.json != ''){
							  		item.json = JSON.parse(item.json)
							  	}
							  })
							 //  this.fenleilist = [...new Set(fenleilist)]
							 //  this.fenleilist.unshift('全部')
							 //  console.log(this.fenleilist)
						      this.total = response.data.data.total
						    }else{
						      this.$message.error(response.data.msg.info);
						    }
						  });
					},
					getUrlParam:function(name) {
					    var query = window.location.search.substring(1);
					    var vars = query.split("&");
					    for (var i=0;i<vars.length;i++) {
					            var pair = vars[i].split("=");
					            if(pair[0] == name){return pair[1];}
					    }
					    return(false);
					},
					//获取商品
					getpro: function() {
						var that = this;
						axios.get('/web/page/list2',{
							params:this.all
						})
							.then(response => {
								if (response.data.msg.code == 0) {
									that.list = response.data.data.data
									that.list.forEach(item=>{
										if(item.json != ''){
											item.json = JSON.parse(item.json)
										}
										console.log(item.json)
									})
								} else {
									that.$message.error(response.data.msg.info);
								}
							})
					},
					go:function(url,id){
						window.location.href = url+'?id='+id
					},
					go2:function(){
						window.location.href = 'chadan.html'
					},
     //                go:function(url,id){
					// 	window.location.href = url+'?id='+id
					// },
					go3:function(){
						window.location.href = 'https://open.haoma.com/?source=000899'
					},
					go4:function(url,id){
						window.location.href = url+'?id='+id+'&source=xcx'
					},
                }
            });

  
        </script>
	</body>
</html>
